﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ladrame.Service;

namespace Ladrame.Web
{
    public partial class SongList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                LoadGenres();
                LoadArtists();
                LoadSongs();
            }
        }

        private void LoadSongs()
        {
          
        }

        private void LoadArtists()
        {
            ArtistService service = new ArtistService();
            var data = service.GetAllArtists();

            ddArtists.DataSource = data;
            ddArtists.DataTextField = "Name";
            ddArtists.DataValueField = "UniqueID";
            ddArtists.DataBind();
        }

        private void LoadGenres()
        {
            GenreService service = new GenreService();
            var data = service.GetAllGenres();

            ddGenres.DataSource = data;
            ddGenres.DataTextField = "Name";
            ddGenres.DataValueField = "UniqueID";
            ddGenres.DataBind();
        }
    }
}